package main

import "fmt"

func main() {
	var numbers = make([]int, 3, 5) // 长度为三，容量为5，
	res := make([]int, 10, 10)

	fmt.Printf("len = %d, cap = %d, slice = %v\n", len(numbers), cap(numbers), numbers)

	numbers = append(numbers, 11)
	fmt.Printf("len = %d, cap = %d, slice = %v\n", len(numbers), cap(numbers), numbers)
	numbers = append(numbers, 9)
	fmt.Printf("len = %d, cap = %d, slice = %v\n", len(numbers), cap(numbers), numbers)

	numbers = append(numbers, 9) // len,cap 会变为原来的两倍
	fmt.Printf("len = %d, cap = %d, slice = %v\n", len(numbers), cap(numbers), numbers)
	fmt.Println("-------------------------")
	fmt.Printf("len = %d,cap = %d,res = %v\n", len(res), cap(res), res)
	res = append(res, 10, 11, 12, 13)
	fmt.Printf("len = %d,cap = %d,res = %v\n", len(res), cap(res), res)

}
